
package com.gw.business.analysis.model;

import java.util.Date;

import com.gw.platform.model.BaseModel;
import com.gw.platform.util.DateUtils;

public class UserTrackDataStatistics implements BaseModel{
    
    /**
	 * 
	 */
	private static final long serialVersionUID = -4372984742167714669L;

	private int id;
    
    // 日期(yyyy-MM-dd)
    private Date dataTime;
    
    // 小时（0-24）
    private int hours;
    
    // 广告媒介
    private String utmcmd;
    
    // 来源
    private String utmcsr;
    
    // 访问次数
    private Integer visitCount = 0;
    
    // 咨询次数
    private Integer advisoryCount = 0;
    
    // 模拟开户总数
    private Integer demoCount = 0;
    
    // 真实开户总数
    private Integer realCount = 0;
    
    // 首次入金数
    private Integer depositCount = 0;
    //平均值
    private double avgNum;
    //类型 guanbo 添加
    private String behaviorDetailType;
    
    public String formatTime;
    
    public double getAvgNum() {
        return avgNum;
    }

    public void setAvgNum(double avgNum) {
        this.avgNum = avgNum;
    }

    
    public int getHours() {
        return hours;
    }
    
    public void setHours(int hours) {
        this.hours = hours;
    }
    
    public String getFormatDataTime() {
        return DateUtils.formatDateToString(this.dataTime, "yyyy-MM-dd");
    }
    
    public int getId() {
        return id;
    }
    
    public void setId(int id) {
        this.id = id;
    }
    
    public Date getDataTime() {
        return dataTime;
    }
    
    public void setDataTime(Date dataTime) {
        this.dataTime = dataTime;
    }
    
    public String getUtmcmd() {
        return utmcmd;
    }
    
    public void setUtmcmd(String utmcmd) {
        this.utmcmd = utmcmd;
    }
    
    public String getUtmcsr() {
        return utmcsr;
    }
    
    public void setUtmcsr(String utmcsr) {
        this.utmcsr = utmcsr;
    }
    
    public Integer getVisitCount() {
        return visitCount;
    }
    
    public void setVisitCount(Integer visitCount) {
        this.visitCount = visitCount;
    }
    
    public Integer getAdvisoryCount() {
        return advisoryCount;
    }
    
    public void setAdvisoryCount(Integer advisoryCount) {
        this.advisoryCount = advisoryCount;
    }
    
    public Integer getDemoCount() {
        return demoCount;
    }
    
    public void setDemoCount(Integer demoCount) {
        this.demoCount = demoCount;
    }
    
    public Integer getRealCount() {
        return realCount;
    }
    
    public void setRealCount(Integer realCount) {
        this.realCount = realCount;
    }
    
    public Integer getDepositCount() {
        return depositCount;
    }
    
    public void setDepositCount(Integer depositCount) {
        this.depositCount = depositCount;
    }
    
    public String getFormatTime() {
        return formatTime;
    }
    
    public void setFormatTime(String formatTime) {
        this.formatTime = formatTime;
    }

	@Override
	public boolean equals(Object obj) {
		UserTrackDataStatistics userTrackDataStatistics= (UserTrackDataStatistics) obj;
		if(this.getHours() == userTrackDataStatistics.getHours() &&
			this.getUtmcmd().equals(userTrackDataStatistics.getUtmcmd()) &&
			this.getUtmcsr().equals(userTrackDataStatistics.getUtmcsr()) && 
			this.getFormatDataTime().equals(userTrackDataStatistics.getFormatDataTime())){
			return true;
		}
		return false;
	}

	@Override
	public int hashCode() {
		if(this.getDataTime() == null) return super.hashCode();
		if(this.getUtmcmd() == null) return super.hashCode();
		if(this.getUtmcsr() == null) return super.hashCode();
		
		return (int) (getDataTime().getTime() + getHours() + getUtmcmd().hashCode() + getUtmcsr().hashCode());
	}

	public String getBehaviorDetailType() {
		return behaviorDetailType;
	}

	public void setBehaviorDetailType(String behaviorDetailType) {
		this.behaviorDetailType = behaviorDetailType;
	}
}
